<template>
  <el-button :type="btnType" @click="open">{{ btnText }}</el-button>
</template>

<script>
export default {
  props: {
    titleText: {
      type: String,
      required: true
    },
    contentText: {
      type: String,
      required: true
    },
    btnText: {
      type: String,
      required: true
    },
    msgInfoType: {
      type: String,
      default: 'warning'
    },
    btnType: {
      type: String,
      default: 'text'
    }
  },
  methods: {
    open() {
      this.$confirm(this.contentText, this.titleText, {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: this.msgInfoType
      }).then(() => {
        this.$emit('callbackFun')
      }).catch(() => {

      })
    }
  }
}

</script>

<style lang="sass" scoped>

</style>
